package com.thghh.task;

import com.thghh.executor.Task;
import lombok.extern.slf4j.Slf4j;

import java.util.Random;

@Slf4j
public class CountTask implements Task<Long> {

    @Override
    public Long task() throws Exception {
        Random random = new Random(System.nanoTime());
        int time = random.nextInt(9000);
        log.info("sleep {} ms", time);
        Thread.sleep(time);
        return System.nanoTime();
    }
}